<template>
  <div id="app">
<!--    <router-view @hook:activated="keepAlive"/>-->
    <router-view />
  </div>
</template>
<script>


export default{
  name:"App",
  created() {
    if(this.$store.state.token!=null){
      this.getUserList()

    }
  },
  methods:{
    keepAlive(){
      const currentRoute=this.$router.currentRoute
      const needKeepAlive=currentRoute.meta.keepAlive
      if(!needKeepAlive){
        return
      }
      const component=this.$refs.keepAlive.$children[0]
      component.$options.rendar=null
      component._inactive=false
    },
    getUserList() {
      axios.get("/fin_user_roster/list").then(res => {
        console.log("获取用户数据：")
        this.finUserRosterList = res.data.data
        this.$store.commit("setUserList", this.finUserRosterList)
        Object.freeze(this.finUserRosterList)
      }).catch(error=>{

      })
    },
  }
}
</script>
<style lang="less">
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  //text-align: center;
  color: #2c3e50;
  .el-table{
    margin-bottom: 1rem;
  }
  .w100{
    width: 100%!important;
  }
  .w90{
    width: 90%!important;
  }
  .el-table .warning-row {
    background: #f6d386;
  }
  .el-table .error-row{
    background: #ee7e52 !important;
    //color:#FFFFFF;
  }
  /*滚动条宽，高*/
  ::-webkit-scrollbar{
    width: 8px;
    height: 8px;
  }
  /*当同时交汇时隐藏*/
  ::-webkit-scrollbar-corner{
    display: block;
  }
  ::-webkit-scrollbar-thumb{
    border-radius: 8px;
    background-color: rgba(0,0,0,0.2);
    //background-color: rgba(64, 158, 255,0.9);

  }

  ::-webkit-scrollbar-thumb,
  ::-webkit-scrollbar-track{
    border-right-color: transparent;;
    border-left-color: rgba(0,0,0,0.1);
  }
  .el-table .success-row {
    background: #f0f9eb;
  }
  span{
    cursor: pointer;
  }
  .fade-enter-active, .fade-leave-active {
    transition: opacity .5s;
  }
  .fade-enter, .fade-leave-to /* .fade-leave-active below version 2.1.8 */ {
    opacity: 0;
  }
  .text-center{
    text-align: center!important;
  }
}

nav {
  padding: 30px;

  a {
    font-weight: bold;
    color: #2c3e50;

    &.router-link-exact-active {
      color: #42b983;
    }
  }
}


</style>
